//  This file is part of Swordbible - http://www.swordwarrior.net
//  Copyright (C) 2003-2008 Manu Mital mitalmanu@hotmail.com

//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2, or (at your option)
//  any later version.

//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.

//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software Foundation,
//  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


// NoModsPage.cpp : implementation file
//

#include "stdafx.h"
#include "SwordBible.h"
#include "NoModsPage.h"
#include ".\nomodspage.h"


// load the font of the page display
CSwordBibleFonts CNoModsPage::font;

// CNoModsPage dialog

IMPLEMENT_DYNAMIC(CNoModsPage, CPropertyPage)
CNoModsPage::CNoModsPage()
	: CPropertyPage(CNoModsPage::IDD)
{

}

CNoModsPage::~CNoModsPage()
{
}

void CNoModsPage::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);

	DDX_Control(pDX, IDC_RICHEDIT_NOMODS, m_richNoMods);
}


BEGIN_MESSAGE_MAP(CNoModsPage, CPropertyPage)
	ON_WM_SIZE()
END_MESSAGE_MAP()


// CNoModsPage message handlers

void CNoModsPage::OnSize(UINT nType, int cx, int cy)
{
	CPropertyPage::OnSize(nType, cx, cy);

	CWnd* pWnd = GetDlgItem(IDC_RICHEDIT_NOMODS);

	// resize the rich edit control
	if( ::IsWindow(pWnd ->GetSafeHwnd() )) 
	pWnd ->SetWindowPos(NULL,10,40,cx-20,cy-50,SWP_NOZORDER | SWP_NOACTIVATE);


	// TODO: Add your message handler code here
}

BOOL CNoModsPage::OnInitDialog()
{
	CPropertyPage::OnInitDialog();

	font.location = AFX_MAINBIBLE; 
	font.Load();
    font.ConstructRTF();


	CString message = font.GetHeaderRTF() + 
		" No modules installed. Please visit http://www.swordwarrior.net/modules.html"
	     " or use the install manager to download modules.";

	m_richNoMods.SetRTF(message);
	


	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
